<?php if (!defined('THINK_PATH')) exit();?> <!DOCTYPE html>
<html>
  
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>
      <?php echo $title; ?> - <?php echo C('TITLE'); ?>
    </title>
     <link rel="stylesheet" href="//at.alicdn.com/t/font_mqhl04idhqx8byb9.css">
      <link rel="stylesheet" href="/project/fly/Public/layui/css/layui.css">
      <link rel="stylesheet" href="/project/fly/Public/css/global.css">
       <script src="/project/fly/Public/layui/layui.js">
        </script>
    <script src="/project/fly/Public/js/jquery-3.2.1.min.js">
        </script>
  </head>
  
  <body>
    <div class="header">
      <div class="main">
        <a class="logo" href="<?php echo U('home/index/index');?>" title="Fly">
          仿Fly社区
        </a>
        <div class="nav">
          <a href="<?php echo U('Home/index/all');?>" class="<?php if(in_array(ACTION_NAME, ['all','unsolve','solve','wonder','myquestion']))echo 'nav-this' ?>">
            <i class="iconfont icon-wenda">
            </i>
            讨论
          </a>
          <a href="javascript:;">
            <i class="iconfont icon-iconmingxinganli" style="top: 2px;">
            </i>
            案例
          </a>
          <a href="javascript:;">
            <i class="iconfont icon-ui">
            </i>
            框架
          </a>
        </div>
          <?php if($_SESSION['uid']){ ?>
           <div class="nav-user">
	         <a class="avatar" href="<?php echo U('Home/userCenter/set');?>">
	           <img src='/project/fly/<?php echo $_SESSION['face'] ?>'>
	           <cite>
	             <?php echo $_SESSION['nickname'] ?>
	           </cite>
	         </a>
           <?php if($_SESSION['msg']!=0 && $_SESSION['msg']<=99){ ?>
              <a class="nav-message" href="<?php echo U('home/userCenter/delMsg',['del'=>1]);?>" title="您有<?php echo $_SESSION['msg']; ?>条未阅读的消息"><?php echo $_SESSION['msg']; ?></a>
            <?php }elseif($_SESSION['msg']>99){ ?>
              <a class="nav-message" href="<?php echo U('home/userCenter/delMsg',['del'=>1]);?>" title="您有99+条未阅读的消息"><?php echo '99+'; ?></a>
            <?php } ?>
	         <div class="nav">
	           <a href="<?php echo U('home/userCenter/set');?>">
	             <i class="iconfont icon-shezhi">
	             </i>
	             设置
	           </a>
	           <a href="<?php echo U('home/logOut/index');?>">
	             <i class="iconfont icon-tuichu" style="top: 0; font-size: 22px;">
	             </i>
	             退了
	           </a>
	         </div>
		     </div>
          	<?php }else{ ?>
				<div class="nav-user">
		          <a class="unlogin" href="/user/login/">
		            <i class="iconfont icon-touxiang">
		            </i>
		          </a>
		          <span>
		            <a href="<?php echo U('home/login/index');?>">
		              登入
		            </a>
		            <a href="<?php echo U('home/reg/index');?>">
		              注册
		            </a>
		          </span>
		          <p class="out-login">
		            <a href="http://fly.layui.com/app/qq" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})"
		            class="iconfont icon-qq" title="QQ登入">
		            </a>
		            <a href="http://fly.layui.com/app/weibo/" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})"
		            class="iconfont icon-weibo" title="微博登入">
		            </a>
		          </p>
          </div>
          	<?php } ?>
         
      </div>
    </div>



<div class="main fly-user-main layui-clear">
      
<ul class="layui-nav layui-nav-tree layui-inline" lay-filter="user">
        <li class="layui-nav-item">
          <a href="<?php  echo U('home/userCenter/center').'?id='.$_SESSION['uid']; ?>">
            <i class="layui-icon">
              &#xe609;
            </i>
            我的主页
          </a>
        </li>
        <?php  $page=explode('/', $_SERVER['PHP_SELF']); $page=end($page); ?>
        <li class="layui-nav-item <?php if($page=='index'||$page=='UserCenter'||$page=='index.html')echo 'layui-this' ?>">
          <a href="<?php echo U('home/userCenter/index');?>">
            <i class="layui-icon">
              &#xe612;
            </i>
            用户中心
          </a>
        </li>
        <li class="layui-nav-item <?php if($page=='set'||$page=='set.html')echo 'layui-this' ?>">
          <a href="<?php echo U('home/userCenter/set');?>">
            <i class="layui-icon">
              &#xe620;
            </i>
            基本设置
          </a>
        </li>
        <li class="layui-nav-item <?php if($page=='msg'||$page=='msg.html')echo 'layui-this' ?>">
          <a href="<?php echo U('home/userCenter/msg');?>">
            <i class="layui-icon">
              &#xe611;
            </i>
            我的消息
          </a>
        </li>
        <li class="layui-nav-item <?php if($page=='can'||$page=='can.html')echo 'layui-this' ?>">
          <a href="<?php echo U('home/userCenter/can');?>">
            <i class="layui-icon">
              &#xe61e;
            </i>
            产品授权
          </a>
        </li>
        <?php ?>
</ul>
<div class="site-tree-mobile layui-hide">
  <i class="layui-icon">
    &#xe602;
  </i>
  
</div>
<div class="site-mobile-shade">
</div>

      <div class="site-mobile-shade">
      </div>
      <div class="fly-panel fly-panel-user" pad20>
        <div class="layui-tab layui-tab-brief" lay-filter="user" id="LAY_uc">
          <div class="fly-msg">
            您的邮箱尚未验证，这比较影响您的帐号安全，
            <a href="/user/activate/">
              立即去激活？
            </a>
          </div>
          <ul class="layui-tab-title" id="LAY_mine">
            <li data-type="mine-jie" lay-id="index" class="layui-this">
              我发的帖（
              <span>
                <?php echo $pub_num; ?>
              </span>
              ）
            </li>
            <li data-type="collection" data-url="/collection/find/" lay-id="collection">
              我收藏的帖（
              <span>
                <?php echo $col_num; ?>
              </span>
              ）
            </li>
          </ul>
          <div class="layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
            <div class="layui-tab-item layui-show">
              <ul class="mine-view jie-row">
                <?php foreach ($question as $v):?>
                  <li>
                    <a class="jie-title" href="<?php echo U('home/discuss/index',array('qid'=>$v['qid']));?>" target="_blank">
                      <?php echo $v['title']; ?>
                    </a>
                    <i>
                      发表于<?php echo Ctime($v['create_time']); ?>
                    </i>
                    <?php if($v['status']=='未结贴'){ ?>
                      <a class="mine-edit" href="<?php echo U('home/publish/index',array('qid'=>$v['qid']));?>">
                        编辑
                      </a>
                    <?php }else{ ?>
                      <p>&nbsp&nbsp&nbsp&nbsp</p><span class="jie-status jie-status-ok">
                        已解决
                      </span>
                    <?php  } ?>
                    <em>
                      <?php echo $v['view_num']; ?>阅/<?php echo $v['answer_num']; ?>答
                    </em>
                  </li>
                <?php endforeach; ?>
              </ul>
              <div id="LAY_page">
              </div>
            </div>
            <div class="layui-tab-item">
              <ul class="mine-view jie-row">
                <?php foreach ($collect as $v): ?>
                  <li>
                    <a class="jie-title" href="<?php echo U('home/discuss/index',array('qid'=>$v['qid']));?>" target="_blank">
                      <?php echo $v['title']; ?>
                    </a>
                    <i>
                      收藏于<?php echo Ctime($v['create_time']); ?>
                    </i>
                  </li>
                <?php endforeach; ?>
              </ul>
              <div id="LAY_page1">
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>


</div>
    <div class="footer">
      <p>
        <a href="http://fly.layui.com/">
          Fly社区
        </a>
        2017 &copy;
        <a href="http://www.layui.com/">
          layui.com
        </a>
      </p>
      <p>
        <a href="http://fly.layui.com/jie/3147.html" target="_blank">
          产品授权
        </a>
        <a href="http://fly.layui.com/jie/8157.html" target="_blank">
          获取Fly社区模版
        </a>
        <a href="http://fly.layui.com/jie/2461.html" target="_blank">
          微信公众号
        </a>
      </p>
    </div>

    
  </body>
	<script type="text/javascript">
		layui.use(['layer', 'form','element'], function(){
		  var layer = layui.layer
		  ,form = layui.form();
		   $ = layui.jquery;
		  /*form.on('submit(login)', function(data){
				$.ajax({
				url:'<?php echo U("home/login/checkdata");?>',
					type: 'POST',
					dataType: 'json',
					data: data.field,
				})
				.done(function(respones) {
					if(respones.error==1){
                        layer.msg(respones.info,function (){

                     })
					}else{
                        layer.alert('登录成功',{icon:6},function (){
                            location.href='<?php echo U("home/user/index");?>';
                        });
                    }
				})
				.fail(function() {
					console.log("error");
				});

				return false;
		   });*/
		 
		
		});
	</script>
</html>